﻿using System;
using System.Linq.Expressions;
using Fabrication.Extensions;

namespace Fabrication
{
    public class ChildPropertySelector<TParent, TChild, TParam>
    {
        public IChildBuilderOptions<TParent, TChild> ChildBuilderOptions { get; private set; }
        public string PropertyName { get; private set; }

        public ChildPropertySelector(IChildBuilderOptions<TParent, TChild> childBuilderOptions, Expression<Func<TChild, TParam>> member)
        {
            PropertyName = member.GetPropertyName();
            ChildBuilderOptions = childBuilderOptions;
        }
    }
}